package com.bailiban.utils;

/**
 * @author zhulang
 * @Classname ResultCode
 * @Description TODO
 * @Date 2020/3/18 23:23
 */
public enum ResultCode {
    /**
     * 成功状态码
     */
    SUCCESS(true, 200, "成功"),
    /**
     * 参数错误： 1001-1999
     */
    PARAM_IS_INVALID(false, 1001, "参数无效"),
    PARAM_IS_BLANK(false, 1002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(false, 1003, "参数类型错误"),
    PARAM_NOT_COMPLETE(false, 1004, "参数缺失"),
    UNKNOWN_REASON(false, 1005, "未知错误"),
    BAD_SQL_GRAMMAR(false, 1006, "sql 语法错误"),
    JSON_PARSE_ERROR(false, 1007, "json 解析异常"),
    FILE_UPLOAD_ERROR(false, 1008, "文件上传错误"),
    EXCEL_DATA_IMPORT_ERROR(false, 1009, "Excel 数据导入错误"),
    REDIS__CONNECTION_ERROR(false, 1010, "Redis 连接错误"),
    /**
     * 用户错误： 2001-2999
     */
    USER_NOT_LOGGED_IN(false, 2001, "用户未登录，访问的路径需要验证，请登录"),
    USER_LOGIN_ERROR(false, 2002, "帐号不存在或密码错误"),
    USER_ACCOUNT_FORBIDDEN(false, 2003, "账户已被禁用"),
    USER_NOT_EXIST(false, 2004, "用户不存在"),
    USER_HAS_EXISTED(false, 2005, "用户已存在"),
    /**
     * 特殊自定义疫情
     */
    COV2019_DATA_IS_EXISTED(false, 3000, "当日数据已保存成功！"),
    COV2019_DATA_GET_FORBIDDEN(false, 3001, "数据抓取受限");
    private Boolean success;
    private Integer code;
    private String message;
    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
    ResultCode(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }
    public Integer getCode() {
        return code;
    }
    public String getMessage() {
        return message;
    }
    public Boolean getSuccess() {
        return success;
    }
}
